﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NerdOnRails.DynamicProxy
{
	 public class Proxy
	 {
		  // Methods
		  #region CreateProxy
		  public static ProxyObject<T> CreateProxy<T>(IInvocation invocationHandler)
				where T : class, new()
		  {
				return new ProxyObject<T>(invocationHandler);
		  }

		  public static ProxyObject<T> CreateProxy<T>(IInvocation invocationHandler, params Object[] args)
				where T : class, new()
		  {
				return new ProxyObject<T>(invocationHandler, args);
		  }

		  public static ProxyObject<T> CreateProxy<T>(Action<String, Type, Object[]> beforeMethodCallback, Action<String, Type, Object> afterMethodCallback)
				where T : class, new()
		  {
				DelegatedInvocationHandler handler = new DelegatedInvocationHandler(beforeMethodCallback, afterMethodCallback);
				return CreateProxy<T>(handler);
		  }
		  #endregion
	 }
}
